home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / aplictns / dtc / part05 < prev    next >
Encoding:
Internet Message Format  |  1990-03-14  |  41.1 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i111: DTC - desktop calendar, Part05/06
  5. Message-ID: <11790@xanth.cs.odu.edu>
  6. Date: 14 Mar 90 01:34:17 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  9. Lines: 1546
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  15. Posting-number: Volume 90, Issue 111
  16. Archive-name: applications/dtc/part05
  17.  
  18. #!/bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 5 (of 6)."
  25. # Contents:  Dtc.For.aa
  26. # Wrapped by tadguy@xanth on Tue Mar 13 20:29:28 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Dtc.For.aa' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'Dtc.For.aa'\"
  30. else
  31. echo shar: Extracting \"'Dtc.For.aa'\" \(38412 characters\)
  32. sed "s/^X//" >'Dtc.For.aa' <<'END_OF_FILE'
  33. XC -h- dtcvax.for  Tue Jul  8 16:01:48 1986
  34. Xc------------------------------------------------------------------------
  35. XC               Desk Top Calender Program
  36. XC                                                     Mitch Wyle 17.11.82
  37. XC       This program provides an on-line appointment calender system
  38. Xc       for daily appointments, week-at-a-glance schedule, and month-
  39. Xc       at-a-glance schedule.  A facility is provided for a daily re-
  40. Xc       minder.
  41. XC       The program has help and menu prompting facilities for the new
  42. Xc       user and the ability to interpret an MCR line for the experienced
  43. Xc       user.  The CRT screen functions are specific to the DEC VT-100
  44. Xc       screen terminal, as is the FORTRAN code.
  45. XC------------------------------------------------------------------------
  46. XC       Compile:
  47. XC------------------------------------------------------------------------
  48. X
  49. Xc       Declarations:
  50. X
  51. X      include comdtc.INC
  52. XC Get common file
  53. X      include escdtc.INC
  54. XC Frequently-used escape sequences
  55. X      include appdtc.Inc
  56. Xc Initialize common declared above
  57. X      include dtcxidate.inc
  58. X      INTEGER*1 ln1
  59. X      Character*1 ln1c
  60. Xc first character of line
  61. X      integer*2 ln2
  62. X      integer*1 incsel(4)
  63. X      logical exflag
  64. XC first two characters of line
  65. X      character*84 comlin
  66. X      character*9 fnamech
  67. Xc      character*60 fnamchh
  68. Xc      character*18 fname
  69. XC Make FORTRAN OPEN happy
  70. X      equivalence (comlin, line(1))
  71. X      equivalence (line(1),ln1)
  72. X      equivalence (ln1, ln2)
  73. X      Equivalence (ln1,ln1c)
  74. Xc      equivalence (line(1),ln1)
  75. X      equivalence (fname,fnamech)
  76. Xc      equivalence (fnamchh,fname)
  77. X
  78. X      character*2 khomescrn,kclrscrn,kdhdw1,kdhdw2,
  79. X     1 kdwide,kresetvattr,krevattr
  80. X      Integer*4  kincmod
  81. X      include stmtfuncsp.for
  82. X      Data comlin /' '/
  83. X      Data fnamech /'DTC.DAT'/
  84. XC Make FORTRAN OPEN happy
  85. XC Length of default value
  86. X       include comdtcd.inc
  87. X       include escdtcd.inc
  88. X      data khomescrn /'[H'/, kclrscrn /'[J'/,
  89. X     1    kdhdw1 /'#3'/, kdhdw2 /'#4'/, kdwide /'#6'/,
  90. X     2    kresetvattr /'[m'/, krevattr /'[7m'/
  91. X
  92. X      data kincmod /1/
  93. XC Default to day
  94. X
  95. Xc End common initialization
  96. X
  97. XC INCMOD will flag day/week/month/year default increment...
  98. Xc 1=day, 2=week, 3=month,4=year
  99. X      Data incsel /'D', 'W', 'M', 'Y'/
  100. XC Auto display after +/-
  101. X
  102. XC       Integer*4  lib$get_foreign
  103. XC Get DCL command line, unparsed
  104. X
  105. X      Data exflag/.false./
  106. XC True if data on DCL command line
  107. X
  108. X      include stmtfunc.for
  109. XC Get useful statement functions
  110. X
  111. Xc Begin code:
  112. X       fname(18)=0
  113. X       fnsz=9
  114. X       comlen=0
  115. X       comidx=0
  116. X       homescrn=khomescrn
  117. X       clrscrn=kclrscrn
  118. X       dhdw1=kdhdw1
  119. X       dhdw2=kdhdw2
  120. X       dwide=kdwide
  121. X       resetvattr=kresetvattr
  122. X       revattr=krevattr
  123. X       incmod=kincmod
  124. Xc       Iterm=7
  125. Xc first set up default data filename
  126. X      Close(Unit=7)
  127. Xc ensure lun 7 closed in case it was pre-opened
  128. Xc Open new window for our operations
  129. Xc units seem to be PELs (we have 640 by 400 in interlace mode)
  130. X      open(unit=7,file='CON:0/0/639/199/Desktop Calendar - H for Help'
  131. X     1  ,err=980)
  132. XC >>> Assumes VT100, interactive <<<
  133. X980   continue
  134. Xc Escape sequences used:
  135. XC       <ESC>7          Save cursor and video attributes
  136. Xc       <ESC>8          Restore ...
  137. Xc       <ESC><          Exit ATS mode
  138. Xc       <ESC>>          Keypad numeric mode (Exit Alternate Keypad mode)
  139. Xc       <ESC>[?4l       Reset scroll mode (jump)
  140. Xc       <ESC>[?6l       Reset origin mode (absolute)
  141. Xc       <ESC>[r         Set top/bottom margins (default - 1:24)
  142. Xc       <ESC>[m         Graphic rendition = primary (default)
  143. Xc       <ESC>[H         Set cursor at home position (upper left)
  144. Xc       <ESC>(B         G0 (SI/^O) = US ASCII
  145. Xc       <ESC>)0         G1 (SO/^N) = Special graphics
  146. Xc       ^O              Shift In (Select G0 (US ASCII))
  147. X
  148. XC Clean up terminal
  149. XC [m
  150. X    Rewind iterm
  151. X      write (iterm,100)
  152. X     1 esc,'<', esc,'>',
  153. X     2 esc,'[?4l', esc,resetvattr,
  154. X     4 esc,'7', esc,'[?6l', esc,'[r', esc,'8'
  155. X       write(iterm,100) esc,'[0;0H',esc,'[26t',esc,'[138u'
  156. Xc set private Amiga modes to inhibit wrap...
  157. Xc set so smallfont will (we hope) have all positions available.
  158. X    Rewind iterm
  159. X 100    format ($, 21a, $)
  160. XC Escape sequences
  161. X      ibigyr=1987
  162. X      iddy=4
  163. X      idmo=7
  164. X      call dtcidate(idmo,iddy,ibigyr)
  165. XC Get current date
  166. X          call dtcicomd
  167. X
  168. Xc       First time, get the MCR line, then parse and process it:
  169. X
  170. Xc INIT  exflag=.false.
  171. XC Assume terminal input
  172. X
  173. XC       istat=lib$get_foreign(comlin,,comlen)
  174. XC       if ((istat .ne. ss$_normal) .or. (comlen .eq. 0))
  175. XC       1   go to 77
  176. X      GOTO 77
  177. Xc Allow for single operation to insert an appointment in upper & lower case
  178. X
  179. XC       if (ln1 .eq. '"') then
  180. XC User quoted the line
  181. XC           do (i = 2, comlen)
  182. XC First of many re-copy opns
  183. XC               line(i-1) = line(i)
  184. XC copy it down
  185. XC           end do
  186. XC           comlen = comlen - 1
  187. XC       end if
  188. X
  189. XC       line(min0(comlen+1, icmln)) = 0
  190. XC Set end of line character
  191. XC       exflag=.true.
  192. XC Flag for exit after one command
  193. X
  194. Xc Generalized parser and scanner routine for line:
  195. X
  196. X 1      continue
  197. XC Loop up here on any input.
  198. X
  199. Xc initialize flags to normal search display sense (show occupied times)
  200. Xc and no special meeting setups...
  201. X
  202. X      rdspfg=0
  203. X      ctlfg=0
  204. X
  205. X 1111   continue
  206. XC Re-enter here, after "+", etc
  207. X
  208. X      comidx = 1
  209. XC Initialize for parsing
  210. X
  211. X      if (lcalpha(ln1))
  212. X     1   ln1 = ln1 -32
  213. XC Change to upper case
  214. Xc Find out what's seen in the line...
  215. X      If ((ln1c .eq. 'D')
  216. X     1   .or. (ln1c .eq. '=')
  217. X     2   .or. (ln1c .eq. '*'))
  218. X     3 then
  219. X          incmod=1
  220. X          call day
  221. XC (line)
  222. XC display daily,
  223. X          go to 6
  224. X
  225. X      else if (ln1c .eq. 'W')
  226. X     1 then
  227. X          incmod=2
  228. X          call week
  229. XC (line)
  230. XC weekly,
  231. X          go to 6
  232. X
  233. X      else if (ln1c .eq. 'M')
  234. X     1 then
  235. X          incmod=3
  236. X          call month
  237. XC (line)
  238. XC or monthly schedules,
  239. X          go to 6
  240. X
  241. X      else if (ln1c .eq. 'Y')
  242. X     1 then
  243. X          incmod=4
  244. X          call year
  245. XC (line)
  246. XC or full-year calendar
  247. X          go to 6
  248. X
  249. Xc flag multiple schedule of meeting to enable multi entry
  250. X      else if (ln1c .eq. 'S')
  251. X     1 then
  252. X          ln1c='D'
  253. X          ctlfg=1
  254. X          incmod=1
  255. X          call day
  256. XC (line)
  257. X          go to 6
  258. X
  259. Xc use G as a schedule that will write appointments in current and
  260. Xc all indirected files.
  261. X      else if (ln1c .eq. 'G')
  262. X     1 then
  263. X          ln1c='D'
  264. X          ctlfg=2
  265. X          incmod=1
  266. X          call day
  267. XC (line)
  268. X          go to 6
  269. X
  270. X      else if ((ln1c .eq. '+') .or. (ln1c .eq. '-'))
  271. X     1 then
  272. X          Call dtcdtinc
  273. XC (line,Incmod)
  274. X          if (ln1 .ne. 0) go to 450
  275. XC something left, schedule it
  276. X
  277. X          ln1c = incsel(incmod)
  278. XC Phony line
  279. X          line(2) = 0
  280. XC End-of-line ?
  281. X          comlen = 1
  282. X          go to 1111
  283. XC Display based on incr
  284. X
  285. Xc reverse display flag so we hunt up free slots... note week, month
  286. Xc routines all get hacked on to do this...
  287. Xc reparse line after copying it down 1 character to remove the 'N'
  288. X      else if (ln1c .eq. 'N')
  289. X     1 then
  290. X          rdspfg=1
  291. X          call shrink(1, ifnb, lnb)
  292. X          go to 1111
  293. X
  294. X      else if (ln1c .eq. 'P')
  295. X     1 then
  296. XC Purge old appointments
  297. X          call strip
  298. XC (line)
  299. X          go to 6
  300. X
  301. X      else if ((ln1c .eq. 'U') .or. (ln1c .eq. 'X'))
  302. X     1 then
  303. X          call strip
  304. XC (line)
  305. XC Cancel or reschedule
  306. X          if (ln1c .gt. ' ') go to 1
  307. XC Re-scan if leftover chars
  308. X          go to 6
  309. X
  310. X      else if (ln1c .eq. 'L')
  311. X     1 then
  312. Xc for locating free time, use week function and scan map
  313. X          ctlfg=1
  314. X          ln1c='W'
  315. X          incmod=2
  316. X          call week
  317. XC (line)
  318. X          go to 6
  319. X
  320. X      else if (ln1c .eq. 'T')
  321. X     1 then
  322. X          ln1c='D'
  323. X          incmod=1
  324. X          call day
  325. XC (line)
  326. XC today's memos then exit
  327. X          go to 999
  328. X
  329. X      else if (ln1c .eq. 'R')
  330. X     1 then
  331. X          ln1c='W'
  332. X          incmod=2
  333. X          call week
  334. XC (line)
  335. XC remind one of this week
  336. X          go to 999
  337. X
  338. X      else if (ln1c .eq. 'C')
  339. X     1 then
  340. XC calendar print for month
  341. X          incmod=3
  342. X          call month
  343. XC (line)
  344. X          go to 999
  345. X
  346. X      else if (ln1c .eq. 'I')
  347. X     1 then
  348. XC Reset default date
  349. X          call dtcicomd
  350. XC Process possible date string
  351. X          go to 6
  352. XC (for testing mods)
  353. X
  354. X      else if ((ln1c .eq. 'H') .or. (ln1c .eq. '?'))
  355. X     1 then
  356. X          call dhelp
  357. XC HELP
  358. XC (instructions)
  359. X          go to 6
  360. X
  361. Xc f filename enters new default data file name to use...
  362. X      else if (ln1c .eq. 'F')
  363. X     1 then
  364. X          call shrink(1,ifnb, lnb)
  365. X          if (ifnb .eq. 0)
  366. X     1     then
  367. X        fnamech = 'DTC.DAT'
  368. X        fnsz = 7
  369. XC Length of default value
  370. X            else
  371. X        do (i=1,lnb)
  372. X            fname(i)=line(i)
  373. X        end do
  374. X        fnsz=lnb
  375. X          end if
  376. X          fname(fnsz+1)=0
  377. XC Make FORTRAN OPEN happy
  378. X          go to 6
  379. X
  380. X      else if ((ln1c .eq. 'Q') .or.
  381. X     1 ((line(1).eq.ichar('E').or.line(1).eq.ichar('e')).and.
  382. X     2 (line(2).eq.ichar('X').or.line(2).eq.ichar('x')))) then
  383. X          go to 999
  384. XC Exeunt omnes
  385. X
  386. X      else
  387. X
  388. XC       Now get a bit fancy:  (play with the line string)
  389. Xc
  390. X      if (ln1c .eq. 'E') go to 450
  391. Xc
  392. X      If (.not. numeric(ln1)) go to 5
  393. XC unknown
  394. Xc
  395. X 450    continue
  396. XC From E above, or leftovers for +/-
  397. XC The first character is a number or E,
  398. Xc call the daily appointment subroutine:
  399. X
  400. X      incmod=1
  401. X      line(icmln) = 0
  402. XC Tag e/o/l
  403. X      call day
  404. XC (line)
  405. X      go to 6
  406. X
  407. X      End If
  408. Xc
  409. X 5      continue
  410. XC First character not recognized
  411. X
  412. Xc Line was uninterpretable, so display menu:
  413. X
  414. X 77     call menu
  415. XC Also display menu first time if no command
  416. X
  417. X 6      continue
  418. XC get a new line and hop back up...
  419. X      if (exflag) go to 999
  420. XC DEBUG: Display remains of line after operations on it
  421. XC
  422. XC       iln = 1
  423. Xc
  424. XC       do i = 1, icmln
  425. Xc
  426. XC       if (line(i) .eq. 0) line(i) = O'32'
  427. XC control Z, displays as BLOT
  428. Xc
  429. XC       if (line(i) .gt. ' ') iln = i
  430. Xc
  431. XC       end do
  432. Xc
  433. XC       WRITE(iterm,93) (line(i), i= 1, iln)
  434. Xc
  435. XC 93    format(' ', <iln>a1, ': DTC: ',$)
  436. X       call dtcat(1,22)
  437. X    Rewind iterm
  438. X       write(iterm,93)
  439. X 93     format(/,' DTC: ',$)
  440. X    Rewind iterm
  441. Xc ---   comlin = ' '
  442. XC Initialize w/ blanks
  443. X    Rewind 7
  444. X       read (7, 7, end=999)  comlin
  445. X
  446. X    Rewind 7
  447. X 7      format(a)
  448. X       Do 750 n=1,80
  449. X       nnn=81-n
  450. X       comlen=nnn
  451. X       if(comlin(nnn:nnn).gt.' ')goto 751
  452. X       comlin(nnn:nnn)=char(0)
  453. X750    continue
  454. X751    continue
  455. X
  456. Xc Mark only stuff read from terminal
  457. Xc (don't want command-input call to try to read terminal)
  458. X
  459. X      line(min0(comlen+1, icmln)) = 0
  460. XC mark for old-style tests
  461. X
  462. X      go to 1
  463. X
  464. X 999    continue
  465. XC EXit, Quit, or ^Z
  466. X      stop
  467. X      end
  468. XC -h- dtcdatinc.for       Tue Jul  8 16:07:46 1986
  469. X      Subroutine dtcdtinc
  470. XC (Line,Incmod)
  471. X
  472. Xc routine to add or subtract sidereal units (days, weeks, months or years)
  473. X
  474. Xc incmod = 1 for day            (in COMMON)
  475. Xc        = 2 for week
  476. Xc        = 3 for month
  477. Xc        = 4 for year
  478. X
  479. Xc format is
  480. Xc  +nn or -nn : add/subtract nn default units
  481. Xc  +/- nnu (u=d,w,m,y) to add/subt that unit
  482. X
  483. Xc output in defdat
  484. X
  485. X      include comdtc.INC
  486. X
  487. X      INTEGER*1 ln1, ll
  488. X      Character*1 ln1c
  489. Xc ml is 14 long to allow refs out of bounds to l for no. days in month...
  490. X
  491. XC length of months - Dec, Jan ... Dec, Jan
  492. X      Integer*4  l(12), ml(14)
  493. X
  494. X      equivalence (l(1), ml(2)), (line, ln1)
  495. X      Equivalence(ln1,ln1c)
  496. X       include stmtfuncsp.for
  497. X       include comdtcd.inc
  498. X
  499. X       Data ml /31, 31,28,31, 30,31,30, 31,31,30, 31,30,31, 31/
  500. X       include stmtfunc.for
  501. X
  502. Xc Begin code
  503. X
  504. X      l(2) = 28
  505. XC Initialize (may have been changed below)
  506. X
  507. X      isign=1
  508. XC Called only if + or - is first char of LINE
  509. X      if (ln1c .eq. '-')
  510. X     1   isign = -1
  511. X
  512. Xc now grab off digits...
  513. X
  514. X      magn=0
  515. XC Initialize magnitude of value
  516. X
  517. X      do (n = 2, icmln)
  518. X          ll = line(n)
  519. X          if (.not.( numeric(ll))) go to 5
  520. XC Exit first non-numeric
  521. X          magn = (magn * 10) + icvtbn1(ll)
  522. X      end do
  523. X
  524. X      n = icmln
  525. XC This many numeric, no overflow???
  526. X
  527. X 5      continue
  528. X
  529. X      if (magn .eq. 0)
  530. X     1   magn = 1
  531. X
  532. X      if (alpha(ll))
  533. X     1 then
  534. X
  535. X          ll = ll .and. ucmask
  536. X
  537. Xc scan for d,w,m,y for units
  538. X
  539. X          if (ll .eq. ichar('D'))
  540. X     1     then
  541. X        incmod=1
  542. X            else if (ll .eq. ichar('W')) then
  543. X        incmod=2
  544. X            else if (ll .eq. ichar('M')) then
  545. X        incmod=3
  546. X            else if (ll .eq. ichar('Y')) then
  547. X        incmod=4
  548. X            else
  549. X        n = n - 1
  550. XC Don't strip one we didn't use: alpha
  551. X          end if
  552. X
  553. X        else
  554. X
  555. X          n = n - 1
  556. XC Don't strip one we didn't use: non-alpha
  557. X
  558. X      end if
  559. X
  560. X      call shrink(n, ifnb, lnb)
  561. XC Shift LINE over
  562. X
  563. Xc magn now has magnitude, isign has sign and incmod has type of increment.
  564. X
  565. X      if (incmod .le. 2)
  566. X     1 then
  567. X          inctyp = 1
  568. X
  569. Xc adjust weeks as being 7 * days and treat together
  570. X
  571. X          if (incmod .eq. 2)
  572. X     1  magn = magn * 7
  573. X
  574. X        else
  575. X          inctyp = incmod - 1
  576. X
  577. X      end if
  578. X
  579. Xc inctyp is 1 for day or week, 2 for month, 3 for year
  580. X
  581. X      if (inctyp .eq. 1)
  582. X     1  then
  583. XC Moving by days
  584. X          iddy = iddy + (isign * magn)
  585. X
  586. Xc loop point if we move forward
  587. X
  588. X 100        if (iddy .gt. l(idmo))
  589. X     1     then
  590. X
  591. X        lyd = 0
  592. X
  593. Xc account for leap years where february is 29 days long...
  594. X
  595. X        if (islpyr(ibigyr) .and. (idmo .eq. 2))
  596. X     1      lyd = 1
  597. X
  598. X        iddy = iddy - l(idmo) - lyd
  599. X        idmo = idmo + 1
  600. X
  601. X        if (idmo .gt. 12)
  602. X     1    then
  603. X            idmo = 1
  604. X            ibigyr = ibigyr + 1
  605. X        end if
  606. X
  607. X        goto 100
  608. X
  609. X          end if
  610. X
  611. Xc loop point if we move back
  612. X
  613. X 110        if (iddy .le. 0)
  614. X     1     then
  615. X
  616. Xc account for leap years. note ml is prev month so check def mo = 3
  617. X
  618. X        lyd = 0
  619. X        if (islpyr(ibigyr) .and. (idmo .eq. 3))
  620. X     1      lyd = 1
  621. X
  622. X        iddy = iddy + ml(idmo) + lyd
  623. X        idmo = idmo - 1
  624. X        if (idmo .le. 0)
  625. X     1    then
  626. X            idmo = 12
  627. X            ibigyr = ibigyr - 1
  628. X
  629. X        end if
  630. X
  631. X        goto 110
  632. X
  633. X          end if
  634. X
  635. X        else if (inctyp .eq. 2) then
  636. XC moving by months
  637. X
  638. X          idmo = idmo + (isign * magn)
  639. X
  640. X 200        if (idmo .gt. 12)
  641. X     1     then
  642. X
  643. X        idmo = idmo - 12
  644. X        ibigyr = ibigyr + 1
  645. X
  646. X        goto 200
  647. X
  648. X          end if
  649. X
  650. X 300        if (idmo .le. 0)
  651. X     1     then
  652. X
  653. X        idmo = idmo + 12
  654. X        ibigyr = ibigyr - 1
  655. X
  656. X        goto 300
  657. X
  658. X          end if
  659. X
  660. X        else if (inctyp .eq. 3) then
  661. X          ibigyr = ibigyr + (isign * magn)
  662. X
  663. X      end if
  664. X
  665. X      if (inctyp .ge. 2)
  666. XC months or years
  667. X     1 then
  668. XC Must check if we exceed month length
  669. X
  670. X          if (islpyr(ibigyr))
  671. X     1     then
  672. X        l(2) = 29
  673. X            else
  674. X        l(2) = 28
  675. X          end if
  676. X
  677. X          iddy = min0(iddy, l(idmo))
  678. XC force last day of month, if necessary
  679. X
  680. X      end if
  681. X
  682. X      idyr = mod(ibigyr, 100)
  683. XC Restrict to current 'century'
  684. X
  685. X      end
  686. X
  687. XC -h- menu.for    Tue Jul  8 16:02:05 1986
  688. Xc-----------------------------------------------------------------------
  689. XC       Menu subroutine
  690. XC       part of Mitch Wyle's DTC program
  691. XC       Inputs:
  692. Xc               None
  693. XC       Output:
  694. Xc               display screen (see below)
  695. XC-----------------------------------------------------------------------
  696. Xc
  697. X
  698. X      SUBROUTINE menu
  699. X
  700. XC       Declarations:
  701. Xc
  702. X
  703. X      include comdtc.INC
  704. XC Need ITERM
  705. X      include escdtc.INC
  706. XC       INTEGER*1 esc /27/
  707. Xc       Integer*4  iterm/6/
  708. X       include comdtcd.inc
  709. X        include escdtcd.inc
  710. X
  711. XC       Initialize:
  712. Xc
  713. X
  714. Xc       iterm = 6
  715. XC       Output terminal unit number
  716. Xc       esc = O'033'
  717. X
  718. Xc       call dtcat(1,1)
  719. X    Rewind iterm
  720. X       write(iterm,1) esc,homescrn, esc,clrscrn
  721. XC       clear screen
  722. X 1      format($,4a, $)
  723. Xc
  724. X       write(iterm,2) ' ', esc,dhdw1
  725. XC       double-height
  726. X 2      format($,3a,13X,'D T C   C o m m a n d s')
  727. XC       ..
  728. Xc      write(iterm,2) ' ', esc,dhdw2
  729. XC       double-width
  730. Xc
  731. X      write(iterm,3)
  732. X 3      format(/,1x,
  733. X     1  8x,'D [mmddyy]   -     Appointment Schedule for dd mm yy',/,
  734. X     2  8x,'W [mmddyy]   -     Week-At-A-Glance for week of dd mm yy',
  735. X     3  /,8x,'M [mmyy]     -     Month-At-A-Glance for mm yy',/,
  736. X     4  8x,'Y [yy]       -     Full Year calendar for yy',/,
  737. X     5  8x,'+ or - nnZ   -     Add/Subt nn Z (Z=D,W,M,Y): change date',
  738. X     5  /,
  739. X     6  8x,'N(cmd str)   -     Reverse display sense of M or W cmd',
  740. X     6     ' (free time)',/,
  741. X     7  8x,'L [mm]dd[yy] n -   Locate time (n * 30 mins.) free for mtg')
  742. X       Write(iterm,303)
  743. X303    format(
  744. X     8  8x,'hh:mm>hh:mm  -     Add or change appointments for hh:mm',/,
  745. X     9  8x,'EV (pseudo time) - Add or change EVening appointment',/,
  746. X     1  8x,'P [mmddyy]   -     Purge appointments prior to mmddyy',/,8x,
  747. X     2  'U [mmddyy] t1[>t2] <cmd> - Unschedule (cancel) appointments',/,
  748. X     3  8x,'X d1 t1 d2 t2 <cmd> - eXchange (reschedule) appointments',/,
  749. X     3  8x,'    (then execute <cmd> if present)', /,
  750. X     4  8x,'S [mmddyy]   -     Schedule multiple activity on mmddyy',/,
  751. X     4  8x,'    (Drops notices in all indirected users files also)',/,
  752. X     5  8x,'G [mmddyy]   -     File activities in multiple files',/,
  753. X     6  8x,'F FILENAME   -     Change default data file to Filename',/,
  754. X     7  8x,'I            -     Reset default date to today.',/,
  755. X     8  8x,'H or ?       -     Help!',/,
  756. X     9  8x,'Q, EX, or ^Z -     Exit')
  757. XC After all that
  758. X    Rewind iterm
  759. Xc
  760. X      return
  761. Xc
  762. X      end
  763. XC -h- dtcidate.for        Tue Jul  8 16:02:23 1986
  764. X      subroutine dtcidate (imr, idr, iyr)
  765. XC Testing aid for DTC - allows for phony value of current date to be
  766. Xc returned to caller, for verifying displays, etc
  767. XC Calling sequence - same as Fortran IDATE
  768. Xc
  769. X      include comdtc.INC
  770. X      include dtcxidate.INC
  771. X      include defcentry.INC
  772. X       include escdtc.inc
  773. X      include comdtcd.inc
  774. X      include escdtcd.inc
  775. Xc
  776. X      if (xim .eq. 0) then
  777. XC Assumes linker initializes to zero
  778. X
  779. X          call date (xim, xid, xiy)
  780. X          if(xiy.gt.100)xiy=mod(xiy,100)
  781. X          xibgyr = icntry + xiy
  782. X          if(xibgyr.lt.100)xibgyr=xibgyr+1900
  783. XC Set long value
  784. X
  785. X      end if
  786. X
  787. X      imr = xim
  788. X      idr = xid
  789. X      iyr = xibgyr
  790. X
  791. X      end
  792. X      subroutine dtcicomd
  793. XC Process "I" command: if no arguments, reset dummy IDATE to current date,
  794. Xc else call dtcdatcvt to parse a date string, store those values in
  795. Xc XIDATE common.
  796. X
  797. X      include comdtc.INC
  798. X      include dtcxidate.INC
  799. X      include escdtc.inc
  800. X      include defcentry.INC
  801. X
  802. X      INTEGER*1 ln1
  803. X      Character*1 ln1c
  804. X      equivalence (line(1), ln1)
  805. X      equivalence(ln1,ln1c)
  806. X
  807. X      include comdtcd.inc
  808. X      include escdtcd.inc
  809. X
  810. X
  811. X      call shrink(1, ifnb, ilnb)
  812. XC Unload command character
  813. X
  814. X      if (ln1 .eq. 0)
  815. X     1 then
  816. X
  817. X          call date (xim, xid, xiy)
  818. X          if(xiy.gt.100)xiy=mod(xiy,100)
  819. X          xibgyr = icntry + xiy
  820. X          if(xibgyr.lt.100)xibgyr=xibgyr+1900
  821. XC Reset
  822. X
  823. Xc          xibgyr = icntry + xiy
  824. XC Set long value
  825. X
  826. X          ibigyr = xibgyr
  827. XC Set values into common
  828. X
  829. X          idmo = xim
  830. X          iddy = xid
  831. X          idyr = xiy
  832. X
  833. X        else
  834. X
  835. X          call dtcdatcvt (3)
  836. XC Parse string
  837. X
  838. X          xim = idmo
  839. XC Set test values
  840. X          xid = iddy
  841. X          xiy = idyr
  842. X
  843. X          xibgyr = ibigyr
  844. X
  845. X      end if
  846. X
  847. X      end
  848. XC -h- dtcrdappt.for       Tue Jul  8 16:02:38 1986
  849. X      subroutine dtcrdappt (eofflg, indflg)
  850. X
  851. Xc search through appointment files for entries matching range of hash values.
  852. Xc opens files if EOFFLG set on entry. INDFLG controls whether indirect files
  853. Xc should be opened as encountered, and whether caller wants to look at indirect
  854. Xc entry or not:
  855. X
  856. Xc       INDFLG
  857. Xc         -1    No processing @
  858. Xc          0    Normal processing
  859. Xc         +1    Return before opening @
  860. X
  861. Xc       EOFFLG  Entry                   Exit
  862. Xc         -1    Initialize              EOF return
  863. Xc          0    Normal re-entry         Normal return, valid entry
  864. Xc         +1    Open @ file             Return for @ filename found
  865. X
  866. Xc Processes both old- and new-format files
  867. Xc       Old: yymmddhhh appt (possibly no blank between HHH & APPT)
  868. Xc       New: yyyymmddhhhh appt
  869. X
  870. Xc Created 19850802, CG, using some code removed from DAY subroutine
  871. X
  872. Xc      implicit none
  873. X
  874. X      Integer*4  eofflg, indflg
  875. XC i/o, i only
  876. X
  877. X      include comdtc.INC
  878. X      include apptdtc.INC
  879. X      include defcentry.INC
  880. XC Default century for old format
  881. X      include escdtc.inc
  882. X      character*1 nullch
  883. XC Old old files had trailing NULs
  884. X      include stmtfuncsp.for
  885. X      Integer*4  i, ij, lth, istrend, nunit
  886. X
  887. X      Data nullch/0/
  888. X      include comdtcd.inc
  889. X      include escdtcd.inc
  890. X      include stmtfunc.for
  891. X
  892. Xc Begin code
  893. X
  894. Xc ***   type 950, irqhash
  895. Xc 950   format(2z9.8)
  896. X
  897. X      if (eofflg .lt. 0)
  898. XC Start scan
  899. X     1 then
  900. X
  901. X          nunit=1
  902. X          close(1)
  903. X          Open (unit=nunit, file=FNc(1:fnsz),
  904. X     1     status='OLD',action='READ',
  905. X     1    form='FORMATTED', err=99)
  906. X
  907. X          eofflg = 0
  908. Xc ***   type  *, ' Opened file'
  909. X      end if
  910. X
  911. Xc loop back up here to continue reading and processing input file:
  912. X
  913. X      do while (eofflg .ge. 0)
  914. X
  915. X 900    format( a)
  916. XC Read all
  917. X 901    format(3i2, i3)
  918. XC Decode old
  919. X 902    format(i4, 2i2, i3)
  920. XC Decode new
  921. X
  922. X          if (eofflg .gt. 0)
  923. X     1     then
  924. XC must open indirect file
  925. X
  926. X        eofflg = 0
  927. X
  928. Xc ***   type 951, work(istart)
  929. Xc *** 951       format (' ', a)
  930. X        Do (nnn=1,80)
  931. X         ilst=81-nnn
  932. X         if(workstr(ilst:ilst).gt.' ') goto 952
  933. Xc find index of end string (last nonspace char)
  934. X        End Do
  935. X952     continue
  936. X        nunit = 2
  937. X        close(2)
  938. X        Open (unit=nunit, file=workstr(istart:ilst), status='old',
  939. X     1        form='formatted', action='READ',
  940. X     2        err=1067)
  941. X
  942. X          end if
  943. X
  944. X          read (nunit, 900, end=400,err=400) workstr
  945. Xc find lth now by hand
  946. Xc assume 80 char work array max
  947. X         do 705 i705=1,80
  948. X         lth=81-i705
  949. X         if(workstr(lth:lth) .gt. ' ') goto 706
  950. X         workstr(lth:lth)=nullch
  951. X705      continue
  952. X706      continue
  953. Xc ***   type  *, ' ', workstr
  954. XC Look for non-blank
  955. XC & non-null
  956. X          do (i = min0(lth, iwrkln), 1, -1)
  957. X        if ((workstr(i:i) .ne. ' ')
  958. X     1      .and. (workstr(i:i) .ne. nullch))
  959. X     2  go to 10
  960. XC Break
  961. X          end do
  962. X
  963. X          i = 1
  964. XC All blank entry ???
  965. X
  966. X 10         lth = i
  967. X
  968. Xc String is filled with blanks regardless of length of record
  969. X
  970. X          if (chnumeric(workstr(10:10)))
  971. X     1     then
  972. XC new format
  973. X        read(workstr, 902, err=30) ihy, ihm, ihd, iht
  974. X        istart = 12
  975. XC Index of first valid character
  976. Xc ***   type  *, ' New format'
  977. X
  978. X            else
  979. XC       Old format
  980. X
  981. X 30             continue
  982. XC       Retry old
  983. X        read(workstr, 901, err=300) ihy, ihm, ihd, iht
  984. X        ihy = ihy + icntry
  985. XC       Insert current century
  986. X
  987. X        istart = 10
  988. XC Assume old, old format
  989. X
  990. Xc ***   type  *, ' Old format'
  991. X
  992. X          end if
  993. XC (workstr(10) is numeric)
  994. X
  995. X          if (workstr(istart:istart) .eq. ' ')
  996. X     1  istart = istart + 1
  997. XC Index of first valid character
  998. X
  999. X          iwkln = max0((lth - istart) + 1, 1)
  1000. X          istrend = (istart + iwkln) - 1
  1001. X          iaptln = max0(min0(iwkln, icmln), 1)
  1002. X
  1003. X          if (ihm .eq. 99)
  1004. X     1     then
  1005. X
  1006. X        ihy = 9999
  1007. XC set all fields
  1008. X        ihd = 99
  1009. X        iht = 999
  1010. X
  1011. X        if ((indflg .ge. 0) .and. (nunit .eq. 1))
  1012. X     1    then
  1013. X
  1014. X            call fnscan(work(istart), icmln - istart + 1,
  1015. X     1                  iwkln, ij)
  1016. XC Common code to check filename
  1017. X
  1018. X            if (ij .ne. 0)
  1019. X     1        then
  1020. XC Skip if no file
  1021. X
  1022. Xc ***   type *, ' IJ = ', ij
  1023. X                eofflg = 1
  1024. X
  1025. X                if (indflg .gt. 0)
  1026. X     1            then
  1027. X
  1028. X                    apptstr = workstr(istart:istrend)
  1029. X
  1030. X                    return
  1031. XC DAY, STRIP want a look
  1032. X
  1033. X                end if
  1034. XC Found 1
  1035. X
  1036. X            end if
  1037. XC non-null file-name
  1038. X
  1039. X        end if
  1040. XC valid place for indirect
  1041. X
  1042. X            else
  1043. XC not filename flag in record
  1044. X
  1045. X        irchash = ihymd(ihy, ihm, ihd)
  1046. XC Compute hash for record
  1047. X
  1048. Xc ***   type 950, irchash
  1049. X
  1050. X        if ((irchash .ge. irqhash(1))
  1051. X     1      .and. (irchash .le. irqhash(2)))
  1052. X     2    then
  1053. XC Found record within range, exit
  1054. X
  1055. X            apptstr = workstr(istart:istrend)
  1056. X
  1057. Xc ***   type *, ' Returning'
  1058. X           return
  1059. XC Break out of loop
  1060. X400                continue
  1061. XC no more appointments left in file.
  1062. Xc ***   type  *, ' EOF'
  1063. X           if (nunit .eq. 1)
  1064. X     1        then
  1065. XC Which file were we reading?
  1066. X               eofflg = -1
  1067. XC real end of file
  1068. X             else
  1069. X1067                   close (2)
  1070. XC Error opening indirect file
  1071. X               nunit=1
  1072. X           end if
  1073. XC Which unit had EOF
  1074. X       end if
  1075. XC Hash range test
  1076. X         end if
  1077. XC type of record
  1078. X300        continue
  1079. XC Error decoding y/m/d/t fields
  1080. X      end do
  1081. XC Read next line from current file
  1082. X      close (1)
  1083. XC Close first-level
  1084. X99     continue
  1085. XC Failed first open
  1086. X      end
  1087. XC -h- dtcmthnam.for       Tue Jul  8 16:03:02 1986
  1088. X      SUBROUTINE dtcmthnam (im,monthn)
  1089. Xc-----------------------------------------------------------------------
  1090. XC       Subroutine dtcmthnam (formerly GABY)
  1091. XC       Part of Mitch Wyle's DTC program
  1092. XC       return a string corresponding to the month number
  1093. Xc       Month number contained in IM.  Send back string in MONTHN.
  1094. Xc       (JANUARY for 1, etc.)
  1095. XC-----------------------------------------------------------------------
  1096. XC       Modified 850315 - Center month names in table, use mixed case - CG
  1097. Xc       Modified 850802 - Renamed DTCMTHNAM
  1098. X
  1099. XC       Declarations:
  1100. Xc
  1101. X      INTEGER*1 monthn(9)
  1102. Xc ***   character*9 monthn
  1103. XC Can't use, char params expect descriptor
  1104. X
  1105. XC       Table of month names and numbers (centered, even lengths biased left):
  1106. Xc
  1107. X
  1108. X      INTEGER*1 months(9,14)
  1109. X      character*9 monthch(14)
  1110. X
  1111. X      equivalence (months, monthch)
  1112. XC       Select the right month and fill monthn with it:
  1113. X      Data monthch/           'December ',
  1114. X     1 ' January ', 'February ', '  March  ', '  April  ',
  1115. X     2 '   May   ', '  June   ', '  July   ', ' August  ',
  1116. X     3 'September', ' October ', 'November ', 'December ',
  1117. X     4 ' January '/
  1118. X
  1119. Xc
  1120. X
  1121. XC ALLOW FOR OVERFLOWS...
  1122. X      IMM=IM+1
  1123. Xc ***   monthn = monthch(imm)
  1124. XC String assignment
  1125. Xc
  1126. X      Do (i=1,9)
  1127. XC byte-at-a-time
  1128. X          Monthn(i) = months(i,imm)
  1129. X      end do
  1130. X
  1131. Xc       All done.
  1132. X
  1133. X      end
  1134. XC -h- dtcalcdow.for       Tue Jul  8 16:03:26 1986
  1135. X        SUBROUTINE dtcalcdow(ib,il,im,iyx)
  1136. Xc-----------------------------------------------------------------------
  1137. XC       DTCALCDOW subroutine
  1138. XC       part of Mitch Wyle's DTC program
  1139. XC       Inputs:
  1140. Xc               im      -       month (number 1-12)
  1141. Xc               iy      -       year  (number 0-9999)
  1142. XC       Outputs:
  1143. Xc               ib      -       integer corresponding to day of week
  1144. Xc                               on which the month begins (1-7)
  1145. Xc               il      -       length of the month in days
  1146. XC       Modified 850117 by CG because it thought New Years 1985 was on Monday
  1147. Xc               when it really was on Tuesday (not counting intervening
  1148. Xc               leap years between 1982 and current as having 366 days).
  1149. Xc       Modified 850724 by Glenn Everhart to work for years between 1900
  1150. Xc               and 1982 (formerly thought all intervening years started
  1151. Xc               on Friday)
  1152. Xc       Modified 850726 by CG to simplify days-since-base calculation.
  1153. Xc               NOTE: Has been reworked to calculate all dates AS IF
  1154. Xc               the Gregorian Calendar had been in effect since AD 1,
  1155. Xc               and that the Gregorian correction for 100 and 400
  1156. Xc               will be valid indefinitely (the 1928 Episcopal
  1157. Xc               Book of Common Prayer indicates this is valid at least
  1158. Xc               until AD (or CE) 8400, but I don't think I, or anybody
  1159. Xc               reading this code within the forseeable future will be
  1160. Xc               around to verify whether it does or doesn't!), see note
  1161. Xc               just before IDAYS computation.  It will also try to compute
  1162. Xc               if a negative year is input (i.e., BC) but probably won't be
  1163. Xc               valid since there was no year zero.  If any calendar phreak
  1164. Xc               wants to figure it out for the Julian calendar, have fun,
  1165. Xc               just keep in mind that the Gregorian superseded the Julian
  1166. Xc               at different times and in different ways in different localities
  1167. Xc               (October 4, 1582 was followed by October 15 in Catholic
  1168. Xc               countries, and another "long sleep" occurred in September 1752
  1169. Xc               in English-speaking realms, but apparently in Sweden
  1170. Xc               the change was effected by omitting Leap Years
  1171. Xc               until the calendar got back in sync
  1172. Xc               (there is a story of a man who didn't celebrate his first
  1173. Xc               birthday until he was sixty years old, leaving Frederic
  1174. Xc               of Pirates of Penzance with little to complain about)
  1175. XC               Russia, Romania, Greece and Turkey did not convert until
  1176. Xc               the twentieth century.
  1177. XC               P.S.: 4th parameter (input year) is no longer modified.
  1178. XC       Modified 850729 by CG - Get rid of loop that added number of days of
  1179. Xc               each month --- why sum a sequence of constants?
  1180. Xc       Modified 850802 by CG - renamed from DANY to DTCALCDOW, removed
  1181. Xc               default century and previously commented-out code
  1182. Xc       Modified 850809 by CG - Insure IB output in range 1..7: negative values
  1183. Xc               (from negative year input) caused DTCDSPMTH to zap its
  1184. Xc               character arrays and display some verrry strange-looking months
  1185. XC-----------------------------------------------------------------------
  1186. Xc
  1187. Xc       Declarations:
  1188. Xc Base value for IDAYS, day-of-week for January 1, AD 1
  1189. XC
  1190. X      parameter (idow = 2)
  1191. X      Integer*4  im
  1192. XC       Julian Month
  1193. X      Integer*4  iyx, iy
  1194. XC       Julian Year
  1195. X      Integer*4  lpyear
  1196. XC       Define additive variable
  1197. X       include stmtfuncsp.for
  1198. Xc Array of months and number days
  1199. X       Integer*4 months(12)
  1200. XC in each one
  1201. Xc array of months containing d/o/w
  1202. X       Integer*4  bomdow(12)
  1203. XC of first day of month
  1204. X
  1205. X      Data months
  1206. X     1 /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
  1207. XC in each one
  1208. X
  1209. Xc array of months containing d/o/w
  1210. X      data bomdow
  1211. X     1 / 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 /
  1212. XC of first day of month
  1213. X      include stmtfunc.for
  1214. XC Need ISLPYR function
  1215. Xc
  1216. Xc Begin code
  1217. Xc
  1218. X      iy = iyx
  1219. XC Copy parameter
  1220. Xc Take care of leap years:
  1221. X      lpyear = 0
  1222. XC Assume "common" year
  1223. X      if (islpyr(iy))
  1224. X     1 then
  1225. X          months(2) = 29
  1226. XC length of February in leap year
  1227. X          if (im .gt. 2) lpyear = 1
  1228. XC Add one to BOM DOW after Feb
  1229. X        else
  1230. X          months(2) = 28
  1231. XC .. "common" year
  1232. X      end if
  1233. X
  1234. Xc Rather than add up all of the days since January First, AD 1
  1235. Xc (which would have been a Monday had the Gregorian calendar been in effect then),
  1236. Xc we note that the day of week of 1 January advances by 1 day per year,
  1237. Xc plus another day the year AFTER a leap year, etc, therefore just add
  1238. Xc values of years, leap years, century years, etc, modulo 7, to figure out
  1239. Xc day of week of the month we are interested in.
  1240. X
  1241. X      itemp = iy - 1
  1242. XC not including current year
  1243. XC Day of week of 1/1/0001
  1244. XC plus number of years
  1245. XC plus number of leap years
  1246. XC less even hundreds
  1247. XC but add back even four hundreds
  1248. XC plus day of week for BOM
  1249. X      idays = idow
  1250. X     1  + itemp
  1251. X     2  + (itemp/4)
  1252. X     3  - (itemp/100)
  1253. X     4  + (itemp/400)
  1254. X     5  + bomdow(im)
  1255. X     6  + lpyear
  1256. XC plus 1 for March or later in leap year
  1257. X
  1258. X      ib = mod ( idays , 7 )
  1259. XC Find day of week 0:6
  1260. X      if (ib .le. 0) ib = ib + 7
  1261. XC In case IY was negative (Sun is day 1)
  1262. X      il = months(im)
  1263. XC Length of the current month
  1264. X
  1265. X      end
  1266. XC -h- dtcdspmth.for       Tue Jul  8 16:03:45 1986
  1267. X      SUBROUTINE dtcdspmth (ib,il,xoff,xspa,YOFF,yspa)
  1268. X
  1269. Xc-----------------------------------------------------------------------
  1270. XC       DTCDSPMTH month printing subroutine (formerly MISCHY)
  1271. XC       part of Mitch Wyle's DTC program
  1272. XC       Inputs:
  1273. Xc               ib      -       begining day of the week
  1274. Xc               il      -       length of month in days
  1275. Xc               xoff    -       offset for x coordinate
  1276. Xc               xspa    -       number of spaces to skip between numbers
  1277. Xc               yoff    -       offset for y coordinate
  1278. Xc               yspa    -       number of lines to skip between lines
  1279. XC       Output:
  1280. Xc               display screen (see below)
  1281. XC       Modified 850301, CG - write full line at a time, rather that each date
  1282. Xc       Modified 850802, CG - Renamed from mischy
  1283. XC-----------------------------------------------------------------------
  1284. Xc
  1285. X
  1286. Xc       Declarations:
  1287. X
  1288. X      Integer*4    ib
  1289. XC       beginning day of the week
  1290. X      Integer*4  il
  1291. XC       length of month in days
  1292. X      Integer*4  xoff
  1293. XC       x offset
  1294. X      Integer*4  xspa
  1295. XC       number of spaces between numbers
  1296. X      Integer*4  yoff
  1297. XC       y offset
  1298. X      Integer*4  yspa
  1299. XC       number of lines to skip between lines
  1300. X
  1301. X      include comdtc.INC
  1302. XC Need ITERM
  1303. X      include escdtc.INC
  1304. X
  1305. X      Integer*4  ix
  1306. XC       x coordinate of where to put day
  1307. X      Integer*4  iy
  1308. XC       y coordinate of where to put day
  1309. X      Integer*4  ip
  1310. XC       the day of the week for date in hand
  1311. X      Integer*4  ixo
  1312. XC       xoff + 1
  1313. X
  1314. Xc numbers as characters
  1315. X      Integer*2  nums(31)
  1316. X      Integer*2  wknums(7)
  1317. Xc 1      format('+',6(a2,<ix>x),a2)
  1318. X      Character*1 nmfmt(18)
  1319. X      Character*2 nmff
  1320. X      Character*18 nmfm
  1321. X      Equivalence(nmfm,nmfmt(1)),(nmfmt(10),nmff)
  1322. X      Data nmfm/'($,6(1A2,01X),1a2)'/
  1323. X      Data nums
  1324. X     1 /      ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9',
  1325. X     2  '10', '11', '12', '13', '14', '15', '16', '17', '18', '19',
  1326. X     3  '20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
  1327. X     4  '30', '31'/
  1328. X
  1329. X      include comdtcd.inc
  1330. X      include escdtcd.inc
  1331. XC To contain copies of above, or blanks
  1332. X
  1333. Xc Begin code
  1334. X
  1335. X      do (i = 1, 7)
  1336. XC       One week's worth
  1337. X          wknums (i) = '  '
  1338. XC       initialize
  1339. X      end do
  1340. X      ip = ib
  1341. X      ix = xspa + 1
  1342. XC       Used in format # 1
  1343. X      ixo = xoff + 1
  1344. X      iy = 4 + YOFF
  1345. X
  1346. Xc Now write month out to screen, one week at a time:
  1347. X
  1348. X      Do (i = 1, il)
  1349. X
  1350. X          wknums(ip) = nums(i)
  1351. XC       Get day as character
  1352. X          If ( ip .eq. 7 )
  1353. XC       is it Saturday again?
  1354. X     1     then
  1355. X        call dtcat(ixo,iy)
  1356. XC       Position cursor for line
  1357. X        write(nmff,110)ix
  1358. X    Rewind iterm
  1359. X        write(iterm,nmfm)wknums       
  1360. X    Rewind iterm
  1361. Xc        write (iterm,1) wknums
  1362. XC       Write filled array
  1363. X        ip = 1
  1364. XC       reset day to Sunday.
  1365. X        iy = iy + 1 + yspa
  1366. XC       move down one line
  1367. X            else
  1368. X        ip = ip + 1
  1369. XC       increment day number
  1370. X          End If
  1371. X
  1372. X      end do
  1373. X
  1374. X      if (ip .ne. 1)
  1375. XC       Partial buffer remains
  1376. X     1 then
  1377. X
  1378. X          call dtcat(ixo,iy)
  1379. XC       Position cursor
  1380. X    Rewind iterm
  1381. Xc          write (iterm,1) (wknums(i), i = 1, ip - 1)
  1382. X       write(nmff,110)ix
  1383. X110    format(i2.2)
  1384. X       write(iterm,nmfm)(wknums(i),i=1,ip-1)       
  1385. X1      format($,a2,1x,$)
  1386. X        Write(iterm,223)
  1387. X223     format(/,1x)
  1388. X    Rewind iterm
  1389. Xc emit trailing crlf...
  1390. XcC       Write rest of array
  1391. X       end if
  1392. X
  1393. Xc 1      format('+',6(a2,<ix>x),a2)
  1394. X      end
  1395. XC -h- dhelpvax.for        Tue Jul  8 16:04:30 1986
  1396. Xc-----------------------------------------------------------------------
  1397. XC       Help subroutine
  1398. XC       part of Mitch Wyle's DTC program
  1399. XC       Inputs:
  1400. Xc               None
  1401. XC       Output:
  1402. Xc               display screen (see below)
  1403. XC-----------------------------------------------------------------------
  1404. Xc
  1405. X
  1406. X      SUBROUTINE dhelp
  1407. X
  1408. X      include comdtc.INC
  1409. X      include escdtc.INC
  1410. Xc
  1411. X
  1412. Xc       Integer*4  iterm/6/
  1413. Xc       INTEGER*1 esc/O'033'/
  1414. X        INTEGER*1 buf(79)
  1415. X         include comdtcd.inc
  1416. X         include escdtcd.inc
  1417. X
  1418. XC       Initialize:
  1419. Xc
  1420. X
  1421. Xc       iterm = 6
  1422. XC       Output terminal unit number
  1423. Xc       esc = o'033'
  1424. X
  1425. X      call dtcat(1,1)
  1426. X    Rewind iterm
  1427. X       write(iterm,91) esc,homescrn, esc,clrscrn
  1428. XC       clear screen
  1429. X       write(iterm,1) ' ', '    D T C  -  Desk Top Calendar'
  1430. Xc      write(iterm,1) ' ', esc,dhdw2, '    D T C  -  Desk Top Calendar'
  1431. Xc
  1432. X 1      format(40a)
  1433. X 91     format($,4a, $)
  1434. X
  1435. X      Open (unit=1,file='DTC.HLP',action='READ',form='FORMATTED',
  1436. X     1  status='OLD', err=9)
  1437. X
  1438. X      Do (i=1, 22)
  1439. X          Read(1,4,end=5) buf
  1440. X        do 301 n=1,78
  1441. X        ibln=79-n
  1442. X        if(buf(ibln).gt.32)goto 302
  1443. X        buf(ibln)=0
  1444. X301     continue
  1445. X302     continue
  1446. X          if (ibln .ne. 0) then
  1447. X        write (iterm,6) (buf(j), j=1,ibln)
  1448. X          else
  1449. X        write (iterm,6)
  1450. X          end if
  1451. X       end do
  1452. Xc
  1453. X 4      format(100a1)
  1454. X 6      format(1x,100a1)
  1455. Xc
  1456. X 5      close(unit=1)
  1457. XC Read end-of-file
  1458. X    Rewind iterm
  1459. X       return
  1460. Xc
  1461. X 9      write(iterm, 99)
  1462. X 99     format(' Help file C:DTC.HLP not found')
  1463. X    Rewind iterm
  1464. X    Return
  1465. X       end
  1466. XC -h- day.for     Tue Jul  8 16:04:45 1986
  1467. Xc-----------------------------------------------------------------------
  1468. XC       Daily Appointment subroutine
  1469. XC       part of Mitch Wyle's DTC program
  1470. XC       Input:
  1471. Xc       line - 72 INTEGER*1s;  Format: D [mmddyy [hh:mm>HH:MM [appointment]]]
  1472. XC       Output:
  1473. Xc               display screen (see below)
  1474. XC-----------------------------------------------------------------------
  1475. XC       Modified 850314, CG, to write day-of-week to daily-appointment screen,
  1476. Xc          and note current time if current day displayed (reverse video)
  1477. Xc       Modified 19850802, CG, to write full date as well, and handle both new-
  1478. Xc          and old-format appointment files.
  1479. Xc       Modified 851218, CG: change default range of appointment from whole day
  1480. Xc          to 8:00 only
  1481. XC       Modified 860220, CG: Check for duplicate appointment times,
  1482. Xc          move and flag them
  1483. X
  1484. X      SUBROUTINE day
  1485. XC (line)
  1486. X
  1487. Xc       Declarations:
  1488. X
  1489. X      include comdtc.INC
  1490. X      include apptdtc.INC
  1491. X      include escdtc.INC
  1492. X
  1493. X      character*100 apstr
  1494. X      INTEGER*1 appnt(icmln)
  1495. XC       appointment string
  1496. X      INTEGER*1 temp(2), ll, ln1, ap1
  1497. X      Character*1 ln1c
  1498. XC       temporary string converting array
  1499. X
  1500. X      INTEGER*1 blot
  1501. XC       ^Z, for entry from display
  1502. X
  1503. X      Integer*4    id, idr
  1504. XC       Julian Day
  1505. X      Integer*4  im, imr
  1506. XC       Julian Month
  1507. X      Integer*4  iye, iyr
  1508. XC       Julian Year
  1509. X      Integer*4  idx, imx, iyx, isx
  1510. XC copies for calling DANY
  1511. X      integer*1 ibsp
  1512. X      Integer*4  eofflg
  1513. X
  1514. XC uses A6 fmt
  1515. XC 'day' is in format
  1516. X      real*8 daylist(7)
  1517. X      character*9 mthlist(12)
  1518. X
  1519. X      character*22 dupl
  1520. XC only 3:22 used
  1521. X      INTEGER*1 dupb(22)
  1522. X      Integer*4  iscnds
  1523. X      equivalence (line, ln1), (apstr, appnt),(apstr, ap1),
  1524. X     1  (dupl, dupb)
  1525. X      character*1 blotc
  1526. X      equivalence(blot,blotc)
  1527. X      Equivalence (ln1,ln1c)
  1528. X       include stmtfuncsp.for
  1529. X       data blotc/'_'/
  1530. X        include comdtcd.inc
  1531. X        include escdtcd.inc
  1532. X
  1533. END_OF_FILE
  1534. if test 38412 -ne `wc -c <'Dtc.For.aa'`; then
  1535.     echo shar: \"'Dtc.For.aa'\" unpacked with wrong size!
  1536. fi
  1537. # end of 'Dtc.For.aa'
  1538. fi
  1539. echo shar: End of archive 5 \(of 6\).
  1540. cp /dev/null ark5isdone
  1541. MISSING=""
  1542. for I in 1 2 3 4 5 6 ; do
  1543.     if test ! -f ark${I}isdone ; then
  1544.     MISSING="${MISSING} ${I}"
  1545.     fi
  1546. done
  1547. if test "${MISSING}" = "" ; then
  1548.     echo You have unpacked all 6 archives.
  1549.     rm -f ark[1-9]isdone
  1550. else
  1551.     echo You still need to unpack the following archives:
  1552.     echo "        " ${MISSING}
  1553. fi
  1554. ##  End of shell archive.
  1555. exit 0
  1556. -- 
  1557. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  1558. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  1559. Post requests for sources, and general discussion to comp.sys.amiga.
  1560.